package Key_Value类型

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object mapValues {
    /*
     针对于(K,V)形式的类型只对V进行操作
     */

    def main(args: Array[String]): Unit = {

        val config: SparkConf = new SparkConf().setMaster("local[*]").setAppName("")

        val sc = new SparkContext(config)

        val rdd = sc.parallelize(Array((3, "aa"), (6, "cc"), (2, "bb"), (1, "dd")))

        val res1: RDD[(Int, String)] = rdd.mapValues(_ + "|||")

        res1.collect().foreach(println)

    }

}
